// headerfile containing the Players class
#ifndef __PLAYERS__
#define __PLAYERS__

class List; // class 'List' exists, - somewhere
class Player; // class 'Player' exists

class Players {
private:
    List* playersLlist;// numbersorted list, contains all players
    int currentuniqueid; // the currently counted unique id of players
    
    friend void writeToFile(Players* pplayers); // these two functions
    friend class Team;
    
public:
    Players(); // default constructor
    
    void uniqueIdInit(); // initialize unique id after reading players from list
    bool addPlayer(); // function for adding players
    bool addPlayer(Player* sentplayer, bool count = 1); // function for adding players
    void printAllPlayers(); // print function for players list
    void printPlayer(int sentnum); // print one player
    void printPlayer(char* senttext); // print one player
    int getPlayer(char* searchedstring, bool nameoraddr = 0); // goes through list
    // one by one, searching for 'searchedstring' vs 'name'(0) or 'address'(1)
    int getPlayer(int playernum); // returns player pointer if
    // 'playersLlist' has playernum
    bool deletePlayer(int playernum); //Function for deleting a player with the number 'playernum'
    int* deletePlayer(char* searchedstring, bool nameoraddr);
    
    ~Players(); // destructor
};

#endif
